<?php
/**
 * 全局加载项
 * $Id: init.php 236 2011-01-10 15:18:09Z bwanglei@gmail.com $
 */

ob_start();
date_default_timezone_set('UTC');
$utctimestamp = time();
if (!defined('AW_ROOT')) define('AW_ROOT',dirname(__FILE__));
require_once AW_ROOT.'/config.php';
require_once AW_ROOT.'/lib/function.base.php';
require_once AW_ROOT.'/lib/function.login.php';
require_once AW_ROOT.'/lib/class.cache.php';
require_once AW_ROOT.'/lib/class.mysql.php';

header('Content-Type: text/html; charset=UTF-8');
doStripslashes();
$DB = MySQL::getInstance();
$CACHE = mkcache::getInstance($timezone);
$options_cache = $CACHE->readCache('options');
extract($options_cache);

$action = isset($_GET['action']) ? addslashes($_GET['action']) : '';

$userData = array();
define('ISLOGIN', isLogin());
define('UID', ISLOGIN == true ? $userData['uid'] : '');
define('BLOG_URL', $blogUrl);
define('TPLS_URL', $blogUrl.'/templates/default');	//模板库地址
define('TPLS_PATH',	AW_ROOT.'/templates/default');	//模板库路径
define('DYNAMIC_BLOGURL', getBlogUrl());	//解决前台多域名ajax跨域
